<template>
    <div style="width: 100%;">
      <van-nav-bar title="标题" left-text="返回"
                   @click-left="backUrl()"
                   fixed left-arrow>
        <template #right>
          <van-icon name="search" size="18" />
        </template>
      </van-nav-bar>
      <div>
        <div id="show_infos" style="width: 100%;height: 35rem;overflow-y: scroll;padding-top: 3rem" updated>
          <div >
            <div  class="chat-sender">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{123}}</div>
              <div style="width: auto;max-width: 200px;min-width: 0px">
                <div class="chat-left_triangle"></div>
                <span>测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试</span>
              </div>
            </div>
            <!--          <div class="chat-notice">-->
            <!--            <span>2017年12月10日 23:13</span>-->
            <!--          </div>-->
            <!-- Right -->
            <div  class="chat-receiver">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{342342}}</div>
              <div style="width: auto;max-width: 200px">
                <div class="chat-right_triangle"></div>
                <span>sdadwdwq</span>
              </div>
            </div>
          </div>
          <div >
            <div  class="chat-sender">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{123}}</div>
              <div style="width: auto;max-width: 200px;min-width: 0px">
                <div class="chat-left_triangle"></div>
                <span>测试测试</span>
              </div>
            </div>
            <!--          <div class="chat-notice">-->
            <!--            <span>2017年12月10日 23:13</span>-->
            <!--          </div>-->
            <!-- Right -->
            <div  class="chat-receiver">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{342342}}</div>
              <div style="width: auto;max-width: 200px">
                <div class="chat-right_triangle"></div>
                <span>sdadwdwq</span>
              </div>
            </div>
          </div>
          <div >
            <div  class="chat-sender">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{123}}</div>
              <div style="width: auto;max-width: 200px;min-width: 0px">
                <div class="chat-left_triangle"></div>
                <span>测试测试</span>
              </div>
            </div>
            <!--          <div class="chat-notice">-->
            <!--            <span>2017年12月10日 23:13</span>-->
            <!--          </div>-->
            <!-- Right -->
            <div  class="chat-receiver">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{342342}}</div>
              <div style="width: auto;max-width: 200px">
                <div class="chat-right_triangle"></div>
                <span>sdadwdwq</span>
              </div>
            </div>
          </div>
          <div >
            <div  class="chat-sender">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{123}}</div>
              <div style="width: auto;max-width: 200px;min-width: 0px">
                <div class="chat-left_triangle"></div>
                <span>测试测试</span>
              </div>
            </div>
            <!--          <div class="chat-notice">-->
            <!--            <span>2017年12月10日 23:13</span>-->
            <!--          </div>-->
            <!-- Right -->
            <div  class="chat-receiver">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{342342}}</div>
              <div style="width: auto;max-width: 200px">
                <div class="chat-right_triangle"></div>
                <span>sdadwdwq</span>
              </div>
            </div>
          </div>
          <div >
            <div  class="chat-sender">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{123}}</div>
              <div style="width: auto;max-width: 200px;min-width: 0px">
                <div class="chat-left_triangle"></div>
                <span>测试测试</span>
              </div>
            </div>
            <!--          <div class="chat-notice">-->
            <!--            <span>2017年12月10日 23:13</span>-->
            <!--          </div>-->
            <!-- Right -->
            <div  class="chat-receiver">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{342342}}</div>
              <div style="width: auto;max-width: 200px">
                <div class="chat-right_triangle"></div>
                <span>sdadwdwq</span>
              </div>
            </div>
          </div>
<!--          <div style="width: 100%">-->
<!--            <div  class="chat-sender">-->
<!--              <div><img :src="$store.getters.getAvatarBaseUrl"></div>-->
<!--              <div>{{123}}</div>-->
<!--              <div style="width: auto;max-width: 200px;min-width: 0px">-->
<!--                <div class="chat-left_triangle"></div>-->
<!--                <span>测试测试</span>-->
<!--              </div>-->
<!--            </div>-->
<!--            &lt;!&ndash;          <div class="chat-notice">&ndash;&gt;-->
<!--            &lt;!&ndash;            <span>2017年12月10日 23:13</span>&ndash;&gt;-->
<!--            &lt;!&ndash;          </div>&ndash;&gt;-->
<!--            &lt;!&ndash; Right &ndash;&gt;-->
<!--            <div  class="chat-receiver">-->
<!--              <div><img :src="$store.getters.getAvatarBaseUrl"></div>-->
<!--              <div>{{342342}}</div>-->
<!--              <div style="width: auto;max-width: 200px">-->
<!--                <div class="chat-right_triangle"></div>-->
<!--                <span>sdadwdwq</span>-->
<!--              </div>-->
<!--            </div>-->
<!--          </div>-->
          <div >
            <div  class="chat-sender">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{123}}</div>
              <div style="width: auto;max-width: 200px;min-width: 0px">
                <div class="chat-left_triangle"></div>
                <span>测试测试</span>
              </div>
            </div>
            <!--          <div class="chat-notice">-->
            <!--            <span>2017年12月10日 23:13</span>-->
            <!--          </div>-->
            <!-- Right -->
            <div  class="chat-receiver">
              <div><img :src="$store.getters.getAvatarBaseUrl"></div>
              <div>{{342342}}</div>
              <div style="width: auto;max-width: 200px">
                <div class="chat-right_triangle"></div>
                <span>sdadwdwq</span>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div style="width: 100%;bottom: 0px;height: 5rem;position: absolute">
        <van-field
          v-model="message"
          rows="1"
          autosize
          type="textarea"
          placeholder="请输入消息"
          style="width: 79%;float: left"
        />
        <van-button style="float: left" round type="info">发送</van-button>
      </div>
    </div>
</template>

<script>
    export default {
        name: "chatBoxView",
      date(){
          return{
            userId:this.$router.params.userId,
            messages:"",
          }
      },
      methods:{
          test(){
            console.log(this.userId)
          },
        backUrl(){
            this.$router.back();
        }
      }
    }
</script>

<style scoped>
  .chat-sender {
    clear: both;
    font-size: 80%;
    float: left;
  }

  .chat-sender div:nth-of-type(1) {
    float: left;
  }

  .chat-sender div:nth-of-type(2) {
    margin: 0 50px 2px 50px;
    padding: 0px;
    color: #848484;
    font-size: 70%;
    text-align: left;
  }

  .chat-sender div:nth-of-type(3) {
    background-color: white;
    /*float: left;*/
    margin: 0 50px 10px 50px;
    padding: 10px 10px 10px 10px;
    border-radius: 7px;
    text-indent: -12px;
  }

  .chat-receiver {
    clear: both;
    font-size: 80%;
    float: right;
  }

  .chat-receiver div:nth-of-type(1) {
    float: right;
  }

  .chat-receiver div:nth-of-type(2) {
    margin: 0px 50px 2px 50px;
    padding: 0px;
    color: #848484;
    font-size: 70%;
    text-align: right;
  }

  .chat-receiver div:nth-of-type(3) {
    /*float:right;*/
    background-color: #b2e281;
    margin: 0px 50px 10px 50px;
    padding: 10px 10px 10px 10px;
    border-radius: 7px;
  }

  .chat-receiver div:first-child img,
  .chat-sender div:first-child img {
    width: 40px;
    height: 40px;
    /*border-radius: 10%;*/
  }

  .chat-left_triangle {
    height: 0px;
    width: 0px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent white transparent transparent;
    position: relative;
    left: -22px;
    top: 3px;
  }

  .chat-right_triangle {
    height: 0px;
    width: 0px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #b2e281;
    position: relative;
    right: -22px;
    top: 3px;
  }

  .chat-notice {
    clear: both;
    font-size: 70%;
    color: white;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 15px;
  }

  .chat-notice span {
    background-color: #cecece;
    line-height: 25px;
    border-radius: 5px;
    padding: 5px 10px;
  }
</style>
